= simple_form_for @user do |f| 
    .w-container
      .w-row
        .w-col.w-col-10.w-col-push-1
          .w-form.card.card-terciary
              .w-row.u-marginbottom-20
                .w-col.w-col-4
                  .fontweight-semibold.fontsize-small.u-marginbottom-10 Newsletters:
                .w-col.w-col-8
                  .w-checkbox.w-clearfix
                      = f.check_box :newsletter, class: 'w-checkbox-input'
                      label.w-form-label.fontsize-base.fontweight-semibold for="checkbox"  Newsletter do Catarse (semanal)
                      div Projetos em destaque e posts do nosso Blog&nbsp;
              .w-row.u-marginbottom-20
                .w-col.w-col-4
                  .fontweight-semibold.fontsize-small.u-marginbottom-10 Projetos que você apoiou:
                .w-col.w-col-8
                  .w-checkbox.w-clearfix
                    = f.check_box :subscribed_to_project_posts, class: 'w-checkbox-input'
                    label.w-form-label.fontsize-base.fontweight-semibold  Quero receber atualizações dos projetos
                    .u-marginbottom-20
                      a.alt-link#toggle-notifications href="#"  Gerenciar as notificações de #{@user.contributed_projects.count} projetos
                    - if @unsubscribes
                      ul.w-list-unstyled.u-radius.card.card-secondary.w-hidden#notifications-box
                        = f.simple_fields_for :unsubscribes, @unsubscribes do |u|
                          li
                            .w-checkbox.w-clearfix
                              = hidden_field_tag "unsubscribes[#{u.object.project.id}]", '' 
                              - unsubscribe_id = "user_unsubscribes_#{u.object.project_id}"
                              = check_box_tag unsubscribe_id, "1", u.object.created_at.nil?, class: 'w-checkbox-input', name: "unsubscribes[#{u.object.project.id}]"
                              label.w-form-label.fontsize-small[for=unsubscribe_id] = u.object.project.name
              .w-row.u-marginbottom-20
                .w-col.w-col-4
                  .fontweight-semibold.fontsize-small.u-marginbottom-10 Categorias que você segue:
                .w-col.w-col-8
                  - @user.category_followers.all.each do |category_follower|
                    .w-checkbox.w-clearfix
                      = check_box_tag "user[category_followers_attributes][][category_id]", category_follower.category.id, true, class: 'w-checkbox-input'
                      = hidden_field_tag "anchor", 'notifications' 
                      label.w-form-label.fontsize-small= category_follower.category.name_pt
              .w-row.u-marginbottom-20
                .w-col.w-col-4
                  .fontweight-semibold.fontsize-small.u-marginbottom-10 Lembretes de projetos:
                .w-col.w-col-8
                  - @user.projects_in_reminder.each do |project|
                    .w-checkbox.w-clearfix
                      = hidden_field_tag "user[reminders][#{project.id}]", false
                      = check_box_tag "user[reminders][#{project.id}]", "1", true, class: 'w-checkbox-input'
                      label.w-form-label.fontsize-small= project.name
      .u-margintop-30
        .w-container
          .w-row
            .w-col.w-col-4.w-col-push-4
              = f.submit 'Salvar',  id: 'save', class:'btn btn-large'
 


